#include "process.h"

const char* str = "|/-\\";

void process()
{
    int rate = 0;
    char bar[SIZE];
    memset(bar, '\0', sizeof(bar)); //初始化
    int num = strlen(str);
    while(rate <= MAX_RATE)
    {
        printf("[%-100s][%d%%][%c]\r", bar, rate, str[rate%num]);
        fflush(stdout);
        usleep(STIME);
        bar[rate++] = STYLE;
    }
    printf("\n");
}

